<script type="text/javascript" src="${base}/scripts/cggl/cgddetail.js"></script>
<div id="cgd_tabs" class="easyui-tabs" detail="true" data-options="fit:true,border:false">
<input type="hidden" id="cgd_cgdh" value="${(cgd.cgdh)!}"/>
<input type="hidden" id="cgd_ewmtime" value="${(ewmtime)!}"/>

<div title="入库单">
<table style="width: 99%;margin: 5px" class="tb tab-t t-bor">
    <input type="hidden" id="cgddetail_id" value="${(cgd.id)!}"/>
    <col width="110px"/>
    <col width=""/>
    <col width="110px"/>
    <col width=""/>
    <col width="110px"/>
    <col width=""/>
    <tr>
        <th>入库单号：</th>
        <td colspan="3">
        ${(cgd.cgdh)!}
        </td>
        <th>采购时间：</th>
        <td>${(cgd.cgsj?date)!}</td>
    </tr>
    <tr>
        <th>采购合同：</th>
        <td>
        <#if cgd?? && cgd.cght??>
            <a href="javascript:void(0);" onclick="viewCghtDetail('${(cgd.cght.id)!}');">
                <span>${(cgd.cght.htbm)!}</span>
            </a>
        </#if>
        </td>
        <th>采购类型：</th>
        <td>
        <#if cgd?? && cgd.cglx?? && cgd.cglx=="cgrk" >采购入库<#else>
            <#if cgd?? && cgd.cglx?? && cgd.cglx=="zddh" >直达到货<#elseif cgd?? && cgd.cglx?? && cgd.cglx=="bght">
                保供采购<#else>统配采购</#if>
        </#if>
        </td>

        <th>供&nbsp;&nbsp;应&nbsp;&nbsp;商：</th>
        <td>
        ${(cgd.gys.jc)!}
        </td>
    </tr>
    <tr>
        <th>发货公司：</th>
        <td>
        ${(cgd.fhgs.qc)!}
        </td>
        <th>发货日期：</th>
        <td>
        ${(cgd.fhrq?date)!}
        </td>
        <th>计划到货日期：</th>
        <td>
        ${(cgd.jhdhrq?date)!}
        </td>
    </tr>
    <tr>
        <th>到货仓库：</th>
        <td>
        <#if cgd?? && cgd.dzck.id??>${(cgd.dzck.mc)!}</#if>
        </td>
        <th>承运单位：</th>
        <td>
        ${(cgd.ysdw.qc)!}
        </td>
        <th>承运号：</th>
        <td>
        ${(cgd.cyh)!}
        </td>
    </tr>
    <tr>
    <#if cgd?? && cgd.cglx?? && cgd.cglx!="zddh" >
        <th>已验收：</th>
        <td>
            <#if cgd?? && cgd.sfys??&&cgd.sfys>是<#else>否</#if>
        </td>
        <th>验收时间：</th>
        <td>
            <#if cgd?? && cgd.ysrq??>${(cgd.ysrq?date)!}</#if>
        </td>
        <th>验收人：</th>
        <td>
        ${(cgd.ysr.xm)!}
        </td>
    </#if>
    </tr>
    <tr>
    <#if cgd?? && cgd.cglx?? && cgd.cglx!="zddh" >
        <th>已入库：</th>
        <td>
            <#if cgd?? && cgd.yrk??&&cgd.yrk>是<#else>否</#if>
        </td>
        <th>入库时间：</th>
        <td>
            <#if cgd?? && cgd.rksj??>${(cgd.rksj?date)!}</#if>
        </td>
        <th>入库人：</th>
        <td>
        ${(cgd.rkr.xm)!}
        </td>
    </#if>
    </tr>
    <tr>
        <th>采购公司：</th>
        <td>
        ${(cgd.cggs.qc)!}
        </td>
        <th>联系电话：</th>
        <td>
        ${(cgd.lxrdh)!}
        </td>
        <th>税率(%)：</th>
        <td>
        ${(cgd.sl)!}
        </td>
    </tr>
    <tr>
        <th>申报公司：</th>
        <td>
        ${(cgd.sbgs.jc)!}
        </td>
        <th>申报部门：</th>
        <td>
        ${(cgd.sbbm.qc)!}
        </td>
        <th>申&nbsp;报&nbsp;&nbsp;人：</th>
        <td>
        ${(cgd.sbr.xm)!}
        </td>
    </tr>
<#if cgd??&&cgd.cglx??&& cgd.cglx=="zddh">
    <tr>
        <th>销售单号：</th>
        <td colspan="3">
            <#if cgd??&&cgd.xsd??>
                <a href="javascript:void(0);" onclick="viewXsdDetail('${(cgd.xsd.id)!}');">
                    <span>${(cgd.xsd.xsdh)!}</span>
                </a>
            </#if>
        </td>
        <th>综合服务费(%)：</th>
        <td>${(cgd.cght.ll?string(",##0.0000"))!}</td>
    </tr>
    <tr>
        <th>销售合同：</th>
        <td>
            <a href="javascript:void(0);" onclick="viewXshtDetail('${(cgd.xsd.xsht.id)!}');">
                <span> ${(cgd.xsd.xsht.htbm)!}</span>
            </a>
        </td>
        <th>客户</th>
        <td>${(cgd.xsd.kh.jc)!}</td>
        <th>提货人</th>
        <td>${(cgd.xsd.thr)!}</td>
    </tr>
</#if>
<#--<tr>-->
<#--<th>是否过户：</th>-->
<#--<td>  <#if cgd??&&cgd.sfgh??&&cgd.sfgh == true>是<#else>否</#if></td>-->
<#--<td style="color:#f45212;" colspan="4">过户操作被勾选表示此物资之前已经被仓储系统线下入库并设置成了一般物资,提交之后,将把这批物资更改成监管物资</td>-->
<#--</tr>-->
    <tr>
        <th>状态：</th>
        <input id="cgdzt" type="hidden" value="${(cgd.zt)!}"/>
        <td>
        <#if cgd??&&cgd.zt??&&cgd.zt == 'ybc'>已保存<#else><#if cgd??&&cgd.zt??&&cgd.zt == 'ytj'>已提交<#else>
            已审批</#if></#if>
        </td>
        <th>结算状态：</th>
        <td>
        ${jszt}
        </td>
        <th>备&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注：</th>
        <td>
        ${(cgd.bz)!}
        </td>
    </tr>
    <tr>
        <th>附&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;件：</th>
        <td class="lian" colspan="5">
        <#if cgd.fjList??>
            <#list cgd.fjList as fj>
                <span class="uploadify-queue-item fileName" style="height:65px;text-align: center;">
                            <a href="${base}/base/fj/downLoadFj?fjId=${fj.id}" class="previewImg"
                               rel="previewImg_${(cght.id)!}" title="${(fj.ccmc)!}"
                               style="display:block;margin: 0 auto;">
                                <img src="${base}/base/fj/downLoadFj?fjId=${fj.id}" width="50" height="50"/>
                            </a>
                        <a href="javascript:void(0);"
                           onclick="window.location.href='${base}/base/fj/downLoadFj?fjId=${fj.id}'">下载
                        </a>
                        </span>
            </#list>
        </#if>
        </td>
    </tr>
    <tr>
        <th>制&nbsp;单&nbsp;&nbsp;人：</th>
        <td>${(cgd.createUser.xm)!}</td>
        <th>制单时间：</th>
        <td>${(cgd.dateCreated?datetime)!}</td>
    <#--<th>付款时间：</th>
    <td>${(cgd.fksj?datetime)!}</td>-->
    </tr>
</table>
</div>
<div title="入库明细">
    <table id="cgd_cgdmx_table" class="easyui-datagrid" url="${base}/cggl/cgdgl/cgdgl_cgmx?cgd.id=${(cgd.id)!}"
           rownumbers="true" fit="true" style="width: 1855px" fitColumns="false" showFooter="true">
        <thead>
        <tr>
        <#--<th data-options="field:'wzgg.oldcode',width:150,align: 'center'" rowspan="2">老物资编码</th>-->
            <th data-options="field:'xsxt_htbm',width:150,align: 'center'" rowspan="2">销售合同号</th>
            <th data-options="field:'xsxt_xsdh',width:150,align: 'center'" rowspan="2">销售合同子项号</th>
            <th data-options="field:'carNo',width:150,align: 'center'" rowspan="2">车皮号</th>
            <th data-options="field:'bindNo',width:150,align: 'center'" rowspan="2">捆包号</th>
            <th data-options="field:'wzgg.code',width:150,align: 'center'" rowspan="2">物资编码</th>
            <th data-options="field:'wzgg.name',width:100,align: 'center'" rowspan="2">物资名称</th>
            <th data-options="field:'wzgg.ggxh',width:120,align: 'center'" rowspan="2">规格型号</th>
            <th data-options="field:'wzgg.cz',width:50,align: 'center'" rowspan="2">材质</th>
            <th data-options="field:'wzgg.dw',width:50,align: 'center'" rowspan="2">单位</th>
            <th data-options="field:'cd.z',width:80,align: 'center'" rowspan="2">产地</th>
            <th colspan="2">发货</th>
            <th data-options="field:'jzfs.z',width:50,align: 'center'" rowspan="2">记重方式</th>
            <th colspan="2">到货</th>
            <th data-options="field:'kh.khbm', hidden:true,align: 'center'" rowspan="2">卡号</th>
            <th data-options="field:'hsj',width:150,formatter:formatJeForHtml,align: 'right'" rowspan="2">含税单价(元)</th>
            <th data-options="field:'bhsj',width:150,formatter:formatJeForHtml,align: 'right'" rowspan="2">不含税单价(元)</th>
           <#-- <th data-options="field:'ph',width:50,align: 'center'" rowspan="2">牌号</th>-->

        </tr>

        <tr>
            <th data-options="field:'js',width:100,formatter:formatSlForHtml,align: 'right'">件数</th>
            <th data-options="field:'sbsl',width:150,formatter:formatSlForHtml,align: 'right'">重量</th>
            <th data-options="field:'rkjs',width:100,formatter:formatSlForHtml,align: 'right'">件数</th>
        <#--<th data-options="field:'rkjz',width:100,formatter:formatSlForHtml,align: 'right'">件重</th>-->
            <th data-options="field:'rksl',width:150,formatter:formatSlForHtml,align: 'right'">重量</th>
        </tr>
        </thead>
    </table>
</div>
<div title="费用明细">
    <table id="cgd_cgdfy_table" class="easyui-datagrid" url="${base}/cggl/cgdgl/cgdgl_cgfy?cgd.id=${(cgd.id)!}"
           rownumbers="true" fit="true" fitColumns="true" showFooter="true">
        <thead>
        <tr>
            <th data-options="field:'sydw.qc',width:50,align: 'center'">收益单位</th>
            <th data-options="field:'fylb.fykmjc',width:50,align: 'center'">费用类别</th>
            <th data-options="field:'jfsl',width:30,formatter:formatSlForHtml,align: 'right'">计费重量</th>
            <th data-options="field:'dj',width:30,formatter:formatJeForHtml,align: 'right'">单价(元)</th>
            <th data-options="field:'je',width:30,formatter:formatJeForHtml,align: 'right'">总金额(元)</th>
            <th data-options="field:'jsdh',width:50,align: 'center'">结算单号</th>
            <th data-options="field:'bz',width:50,align: 'center'">备注</th>
        </tr>
        </thead>
    </table>
</div>
<div title="入库单打印">
    <div id="cgddetail-toolbar">
        <div class="PTools">
            <ul class="niu">
                <li><span class="xuan">选择打印机：</span>
                    <select class="ze" name="" style="">
                        <option>——默认——</option>
                    </select>
                </li>
                <li><a class="she" href="javascript:void(0);" onclick="cgd_detail_checkIsInstall()">检查插件</a></li>
                <li><a class="watch" href="javascript:void(0);" onclick="cgd_detail_printPreview()">打印</a></li>
            <#--<li><a class="pen" href="javascript:void(0);" onclick="cgd_detail_print()">打印</a></li>-->
            </ul>
        </div>
        <table>
            <input type="hidden" id="cgd_detail_newCode" value="on"/>
            <input type="hidden" id="cgd_detail_oldCode" value="off"/>
            <tr>
                <td>
                    新物资编码：<input type="checkbox" id="cgd_newCode" checked="true"/>&nbsp;&nbsp;&nbsp;
                    老物资编码：<input type="checkbox" id="cgd_oldCode"/>
                </td>
            </tr>
        </table>
        <div id="cgddydetail_id">
            <object id="CGD_LODOP_OB" classid="clsid:2105C259-1E0C-4534-8141-A753534CB4CA" width=0 height=0>
                <embed id="CGD_LODOP_EM" type="application/x-print-lodop" width=0 height=0
                       pluginspage="install_lodop32.exe"></embed>
            </object>
            <div id="cgddetail_print_id" class="textcon">
                <table class="tb" style="width: 100%;font-size:13px;">
                    <colgroup>
                        <col width="10%;"/>
                        <col width="30%"/>
                        <col width="15%;"/>
                        <col width="20%"/>
                        <col width="12%;"/>
                        <col width="21%"/>
                    </colgroup>
                    <tbody>
                    <tr>
                        <th>收货单位:</th>
                        <td><input class="input-tian" readonly="readonly"
                                   value="${(cgd.cggs.qc)!}"/></td>
                        <td rowspan="3" colspan="2" style="text-align: center;font-size: 18px">
                            <span id="xsddy_csl" style="font-size: 20px;">${(cgd.cggs.jc)!}入库单(采购-收条) </span>
                        </td>
                        <th>入库单编号:</th>
                        <td><input class="input-tian" readonly="readonly"
                                   value="${(cgd.cgdh)!}"/></td>
                    </tr>
                    <tr>
                        <th>入库状态:</th>
                        <td>
                        <#if cgd.yrk><input class="input-tian" readonly="readonly"
                                            value="已入库"/><#else>
                            <input class="input-tian" readonly="readonly" value="未入库"/></#if>
                        </td>
                        <th>制单日期:</th>
                        <td><input class="input-tian" readonly="readonly"
                                   value="<#if cgd??>${(cgd.dateCreated?date)!}</#if>"/></td>
                    </tr>
                    <tr>
                        <th>入库单位:</th>
                        <td><input class="input-tian" readonly="readonly"
                                   value="${(cgd.gys.qc)!}"/></td>
                        <th>要求采购日期:</th>
                        <td><input class="input-tian" readonly="readonly"
                                   value="${(cgd.jhdhrq?date)!}"/></td>
                    </tr>
                    </tbody>
                </table>
            </div>
            <div id="cgddetail_cgd_id" class="textcon"></div>
            <div id="cgddy_print_end" class="textcon">
                <table class="tb" style="width: 100%;font-size:13px;">
                    <colgroup>
                        <col width="10%;"/>
                        <col width="20%"/>
                        <col width="10%;"/>
                        <col width="20%"/>
                        <col width="10%;"/>
                        <col width="20%"/>
                    </colgroup>
                    <tbody>
                    <tr>
                        <th style="font-size: 12px;">制&nbsp;单&nbsp;人:</th>
                        <td>
                            <input class="input-tian" readonly="readonly"
                                   value="<#if cgd??>${(cgd.createUser.xm)!}</#if>"/>

                        </td>
                        <th style="font-size: 12px;">收&nbsp;货&nbsp;人:</th>
                        <td>
                            <input class="input-tian" readonly="readonly"
                                   value="<#if cgd??>${(cgd.rkr.xm)!}</#if>"/>
                        </td>
                        <th style="font-size: 12px;">验&nbsp;收&nbsp;组:</th>
                        <td>
                            <input class="input-tian" readonly="readonly"
                                   value="<#if cgd??>${(cgd.ysr.xm)!}</#if>"/>
                        </td>
                    </tr>
                    <tr>
                        <th style="font-size: 12px;">备&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注:</th>
                        <td colspan="7">
                            <input class="input-tian" readonly="readonly"
                                   value=""/>
                        </td>
                    </tr>
                    <tr>
                        <th></th>
                        <td colspan="7"><span
                                style="margin-left: 400px;">${(CurrentTime?string('yyyy-MM-dd HH:mm:ss'))!}</span></td>
                    </tr>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>
</div>